<template>
   <div class="right-container">
       <div id="article-title">

           <el-input placeholder="请输入文章标题"/>
       </div>
            <div id="editor-title"></div>
            <div id ="editor"></div>
   </div>
</template>
<script>
import E from 'wangeditor'
var editor;
export default {
  data(){
      return {
          
      }
  },
 computed:{
        // title(){
        //     return this.$store.getters.getArticle.title;
        // },
         getContent(){
             return this.$store.state.contentStore.article;
         }
    },
  watch:{
      getContent(val){
          editor.txt.html(val.content)
      }
  },
  mounted () {
     editor = new E('#editor-title','#editor');
     editor.customConfig.uploadImgShowBase64 = true   // 使用 base64 保存图片
     editor.customConfig.zIndex =1
     editor.create();
  }
  
}
</script>
<style scoped>
    .right-container{
      flex-grow:1;
     
    }
    #article-title{
          width: 700px;
    }
    #editor-title{
          margin-left:200px;
          
    }
    #editor{
        height: 90%;    
        border: 1px solid #ddd;
        width: 700px;
        background-color: #EEE9E9;
    }
</style>
